import app from "../../../app";
import { prop_min_type } from "../../../shared/interface";
import { Tpl_attribute, Tpl_attribute_pet, template } from "../../../shared/master/MsgAction";
import word from "../../word/word";
import { SKILL } from "../skill/SK_active";
import { _Cls_Points } from "./att/_Points";
import { _Cls_Att } from "./att/_Att";
import { CreateBody_base, baseBody } from "./baseBody";
import { player } from "./player";

/**
 * npc
 */
export class npc extends baseBody {
    icon: string = '🤠';
    tips: string = '我是一个莫得感情的NPC'
    path:string = 'minGame/Guess/Menu'
    get nickName(): string {
        return `${this.icon}${this.name}`
    }
    constructor() {
        super()
        this.setBodyType('npc')
    }
    tick(user:player){
        user._callApi(this.path,{})
    }
    setCreateCfg(cfg: any) {
        this.tips = cfg.tips;
        this.icon = cfg.icon;
        this.path = cfg.path;
    }
    getMsgAttTpl() {
        this.update_attributes();
        let p = new _Cls_Points();
        p.add(this.P);
        p.add(this.Job);


        let att = new _Cls_Att();
        att.reset(this._attributes);
        let tpl: Tpl_attribute_pet = {
            render_type: 'pet_concise',
            name: this.name,
            hp_now: this.Hp_now,
            score: this.getScore(),
            mp_now: this.Mp_now,
            leve: this.leve,
            Points: p,
            attributes: att,
            body_type: "pet",
            style_id: this.style_id
        }
        return { template: template.attribute_pet, data: tpl };
    }

}